﻿using System;
using System.Threading;

namespace LogNaga
{
	/// <summary>
	/// 对Exception类型的扩张那
	/// </summary>
	internal static class ExceptionExtensions
	{
		/// <summary>
		/// 判断是否是需要throw出去的异常
		/// </summary>
		/// <param name="exception"></param>
		/// <returns></returns>
		internal static bool IsImportant(this Exception exception)
		{
			if (exception == null)
			{
				return false;
			}

			return exception is StackOverflowException || exception is OutOfMemoryException || exception is ThreadAbortException;
		}
	}
}
